#pragma once
#include"Struct.h"
#include"index_manage.h"
#include"util.h"
#include<vector>
#include"CURDTools.h"
using namespace std;
class ServerDB
{
public:
	CFile file;
	ServerDB();
	~ServerDB();
	vector<DB_Struct>dbVector ;
	CString fileName;
	CString cur_db;

	index_manage indexM;

  bool  DB_Use(char* ,string  &); //*
  bool DB_Show(vector<string>& info); //*

  bool Table_show(vector<string>& info,string db); //*
  bool Table_desc(char *,string,string &);  //*

	bool DB_Create( char*,string&);   //*
	bool DB_Drop(char*name,string &);//*
	bool Table_Create(vector<string>,string,string&);//*
	bool Table_Drop(char*name,string db,string &);//*

	bool Table_Alter_Add(const char*tname, string,vector<string>,string &); //*
	bool ServerDB::Table_Alter_Modify(const char*tname, string db, vector<string>field_info, string &msg) ; ///TODO bug修复
	bool ServerDB::Table_Alter_Drop(const char*tname, string,string field, string &msg);  //*

	bool Index_Create(string tname,string ,string column,string &); 

	int Table_Select(const char*,string db,vector<insert_model>,vector<struct_where>,string& ); //*
	int Table_Insert(const char*,vector<insert_model>,string db,string &);   //*
	int  ServerDB::Table_update(const char*tname,string db, vector<insert_model>fields, vector<struct_where>where, string &msg); //*
	int Table_Delete(const char*tname, string db, vector<struct_where>where, string &msg);  //*
	
private:
};

